package com.ezops.dao.facade;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;

import com.ezops.dao.generics.search.ISearch;
import com.ezops.models.DomainEntity;

public abstract class DataTransferFacadeImpl<T extends DomainEntity> implements
		DataTransferFacade<T> {

	final static Logger logger = LoggerFactory
			.getLogger(DataTransferFacadeImpl.class);

	
	@Override
	@Transactional
	public void save(T domainEntity) {
		getDataAccessObject().save(domainEntity);
	}

	@Transactional
	@Override
	public void delete(T domainentity) {
		getDataAccessObject().remove(domainentity);
	}

	@Override
	public T find(T domainEntity) {
		return getDataAccessObject().find(domainEntity.getId());
	}

	@Override
	public List<T> findAll() {
		return getDataAccessObject().findAll();
	}

	@Override
	public List<T> search(ISearch search) {
		return getDataAccessObject().search(search);
	}

	@Override
	public T searchUnique(ISearch search) {

		return getDataAccessObject().searchUnique(search);
	}

}
